package com.pocket.demo.core.context;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * @author cookie.
 **/
public class TokenContext {
    private static final TransmittableThreadLocal<String> TOKEN_INHERITABLE_THREAD_LOCAL = new TransmittableThreadLocal<>();

    public static String getToken() {
        return TOKEN_INHERITABLE_THREAD_LOCAL.get();
    }

    public static void setToken(String token) {
        TOKEN_INHERITABLE_THREAD_LOCAL.set(token);
    }

    public static void remove() {
        TOKEN_INHERITABLE_THREAD_LOCAL.remove();
    }
}
